import request from '@/utils/request'
import store from '@/store'

const customer_id = store.getters.customer_id

export function getList(query) {
  return request({
    url: '/black-list/' + customer_id,
    method: 'get',
    params: query
  })
}

export function detail(id) {
  return request({
    url: `/black-list-info/${id}`,
    method: 'get'
  })
}

export function create(data) {
  data.customer_id = customer_id
  return request({
    url: '/black-list/new',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/black-list/update',
    method: 'post',
    data
  })
}

export function dataList(id, data) {
  return request({
    url: `/black-list-data/${id}`,
    method: 'get',
    params: data
  })
}

export function dataCreate(data) {
  return request({
    url: '/black-list-data/new',
    method: 'post',
    data
  })
}
